﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="VoucherRuleDetail.aspx.cs" Inherits="ZLCMS.Web.SystemManage.Basics.Shop.Voucher.VoucherRuleDetail" ValidateRequest="False" %>


<%@ Register src="~/SystemManage/Control/JGridControl.ascx" tagname="JGridControl" tagprefix="uc2" %>
<%@ Register src="/SystemManage/Control/SinglePictureControl.ascx" tagname="SinglePictureControl" tagprefix="uc1" %>

<form id="pageForm" method="post" runat="Server" class="pageForm required-validate"
    onsubmit="return validateCallback(this, navTabAjaxDone);" action="/SystemManage/Basics/Shop/Voucher/VoucherRuleDetail.aspx">

<div class="pageContent">
    <div class="pageFormContent" layoutH="56">
    	

		<h3 class="contentTitle">基本信息</h3>  
        <dl class="nowrap">

            <dt>配置名称：</dt>
            <dd><asp:TextBox ID="title" runat="server" class="required" width="300px"></asp:TextBox></dd>

        </dl>
        

        <dl class="nowrap">
            <dt>领取时间：</dt>
            <dd>
            <table border="0" cellspacing="0" cellpadding="0">
            	<tr>
            		<td><asp:TextBox ID="start" runat="server" class="required date" datefmt="yyyy-MM-dd HH:mm:ss"></asp:TextBox><a class="inputDateButton" href="javascript:;">选择</a></td>
                    <td>&nbsp;&nbsp;至&nbsp;&nbsp;</td>
                    <td><asp:TextBox ID="end" runat="server" class="required date" datefmt="yyyy-MM-dd HH:mm:ss"></asp:TextBox><a class="inputDateButton" href="javascript:;">选择</a>
                    </td>
            	</tr>
            </table></dd>
       </dl> 
        <dl class="nowrap">
            <dt>优惠券标题：</dt>
            <dd><asp:textbox runat="server" ID="txt_title" class="required" width="300px" ></asp:textbox></dd>
        </dl> 
        <dl class="nowrap">
            <dt>券号前缀：</dt>
            <dd><asp:textbox runat="server" ID="txt_ahead" class="required"></asp:textbox></dd>
        </dl>    
           
        <dl class="nowrap">
            <dt>有效期</dt>
            <dd>
             <table border="0" cellspacing="0" cellpadding="0">
            	<tr>
            		<td><asp:TextBox ID="txt_start"  runat="server" class="required date" datefmt="yyyy-MM-dd HH:mm:ss" prop="Start"></asp:TextBox><a class="inputDateButton" href="javascript:;">选择</a></td>
                    <td>&nbsp;&nbsp;至&nbsp;&nbsp;</td>
                    <td><asp:TextBox ID="txt_end"  runat="server" class="required date" datefmt="yyyy-MM-dd HH:mm:ss" prop="End"></asp:TextBox><a class="inputDateButton" href="javascript:;">选择</a>
                    </td>
            	</tr>
            </table>
            </dd> 
        </dl>  
        <dl class="nowrap">
            <dt>抵扣金额（元）：</dt>
            <dd><asp:textbox runat="server" ID="txt_amount" width="80px" prop="Amount" class="required number"></asp:textbox><span class="info">使用优惠券时可以抵扣的金额</span></dd>
        </dl>     
        
        <dl class="nowrap">
            <dt>最低消费金额（元）：</dt>
            <dd><asp:textbox runat="server" width="80px" ID="txt_OrderMinAmount" class="required number"></asp:textbox><span class="info">订单金额大于最低消费金额时才能使用该劵，0表示不限制</span></dd>

        </dl>   
        <dl class="nowrap">
            <dt>简介：</dt>
            <dd>
                <asp:textbox ID="summary" runat="server" Columns="75" Rows="4" TextMode="MultiLine"></asp:textbox>
            </dd>
        </dl>

        <dl class="nowrap">
            <dt>封面图片：</dt>
            <dd>
                <uc1:SinglePictureControl ID="imageUrl" runat="server" />
            </dd>
        </dl>
        <dl class="nowrap">
            <dt>背景图片：</dt>
            <dd>
                <uc1:SinglePictureControl ID="backgroundUrl" runat="server" />
            </dd>
        </dl>
	    <dl class="nowrap">
            <dt>活动内容：</dt>
            <dd>
                <textarea class="editor" rows="25" cols="75" style="width: 100%" id="txtContent" runat="Server"
                    uplinkurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=zip,rar,txt" uplinkext="zip,rar,txt"
                    upimgurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=jpg,jpeg,gif,png" upimgext="jpg,jpeg,gif,png"
                    upflashurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=swf" upflashext="swf"
                    upmediaurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=avi" upmediaext="avi">
                </textarea>
            </dd>
        </dl>   
                    
<%--优惠券设置--end--%>
		<h3 class="contentTitle">应用设置</h3> 
       <dl class="nowrap">
            <dd><span style="color:red;">&nbsp;活动开启后，优惠券内容不得更改</span>  </dd>
        </dl>     
       <dl>
       <dt>活动状态：</dt>
            <dd>
            <table border="0" cellspacing="0" cellpadding="0" width="100%">
            	<tr>
            		<td align=left>
                    <span style="float: left; line-height: 21px;"><%=ZLCMS.Business.Util.NormalActivityUtil.GetActivityStatusName(item.Status )%></span>
                    </td>
                    
            		<td align=right>
                    <%if (item.Status  == "0" && ViewState["uid"] != null)
                      { %>
                    <a class="button" onclick="changeStatus($(this),<%=ViewState["uid"] %>, '1');"><span>启动</span></a>
                    <%} %>
                    <%if (item.Status  == "1")
                      { %>
                    <a class="button" onclick="changeStatus($(this),<%=ViewState["uid"] %>, '2');"><span>暂停</span></a>&nbsp;&nbsp;
                    <a class="button" onclick="changeStatus($(this),<%=ViewState["uid"] %>, '9');"><span>结束</span></a>
                    <%} %>
                    <%if (item.Status  == "2")
                      { %>
                    <a class="button" onclick="changeStatus($(this),<%=ViewState["uid"] %>, '1');"><span>启动</span></a>&nbsp;&nbsp;
                    <a class="button" onclick="changeStatus($(this),<%=ViewState["uid"] %>, '9');"><span>结束</span></a>
                    <%} %>
                    </td>
            	</tr>
            </table>
            
            </dd>
       </dl>
         
        <dl class="nowrap">
            <dt>是否预先生成：</dt>
            <dd><asp:dropdownlist runat="server" id="ddl_create" Width="130px" onchange="createc(this)" ></asp:dropdownlist><span class="info">预先生成优惠券的总量，若选‘否’则获取时才生成</span></dd>
        </dl>         
        <dl class="nowrap" id="createcount" style="<%= item.IsAutogeneration == "0" ? "display: none;" : "" %>">
            <dt>生成数量：</dt>
            <dd><asp:textbox runat="server" width="80px" ID="txt_counter" class="required number"></asp:textbox><span class="info">预先生成优惠券的总量</span></dd>
        </dl>    
        <dl class="nowrap">
            <dt>领取限制：</dt>
            <dd>
            
                <asp:TextBox ID="limitday" runat="server" width="50px" class="required digits"></asp:TextBox>
                <span style="float: left; line-height: 21px;margin:0 10px;">天可以参与</span><asp:TextBox ID="limitcount" runat="server" width="50px" class="required digits"></asp:TextBox>
                <span style="float: left; line-height: 21px;margin-left:10px;">次</span>
                <span style="line-height: 21px;margin-left:10px;" class="info">设置为0表示不受限制</span>
             </dd>
       </dl>
        <dl class="nowrap">
            <dt>备注：</dt>
            <dd>
         <asp:textbox  ID="txt_memo"  runat="server"  Columns="60" Rows="4"  TextMode="MultiLine" ></asp:textbox> 
            </dd>
        </dl> 


	</div>
        
    <div class="formBar">
    <input id="submit_op" name="submit_op" type="hidden" />
	    <ul>
			<li>
	        <div class="buttonActive"><div class="buttonContent"><button onclick="$('#submit_op', navTab.getCurrentPanel()).val('0');" type="submit">保存</button></div></div>
            </li>
			<li>
		    <div class="button"><div class="buttonContent">
		    <button type="button" onclick="navTab.openTab('VoucherRuleDetail', '/SystemManage/Basics/Shop/Voucher/VoucherRuleDetail.aspx',{data:{tabid:'VoucherRuleDetail'}});">取消并新增</button></div></div>
			</li>
            <li>
	        <div class="buttonActive"><div class="buttonContent"><button onclick="$('#submit_op', navTab.getCurrentPanel()).val('1');" type="submit">保存并新增</button></div></div>
            </li>
			<li>
		    <div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div>
			</li>
		</ul>
    </div>
</div>
<script type="text/javascript">
    function createc(ui) {
        $this = $(ui);
        if ($this.val() == "0") {
            $("#createcount", navTab.getCurrentPanel()).hide();
            $("#<%= txt_counter.ClientID %>", navTab.getCurrentPanel()).val(0);
        }
        else {
            $("#createcount", navTab.getCurrentPanel()).show();
            $("#<%= txt_counter.ClientID %>", navTab.getCurrentPanel()).val(100);
        }
    }
</script> 
</form>